package com.sunday.boot3.user.center.provider.impl;

import com.sunday.common.core.remoting.base.page.PageResultDTO;
import com.sunday.common.core.remoting.base.response.Response;
import com.sunday.boot3.user.center.controller.RolePermissionsController;
import com.sunday.boot3.user.center.pojo.dto.role.permissions.SaveRolePermissionsReqDTO;
import com.sunday.boot3.user.center.pojo.dto.role.permissions.UpdateRolePermissionsReqDTO;
import com.sunday.boot3.user.center.pojo.dto.role.permissions.PageRolePermissionsResDTO;
import com.sunday.boot3.user.center.pojo.dto.role.permissions.PageRolePermissionsReqDTO;
import com.sunday.boot3.user.center.pojo.dto.role.permissions.RemoveRolePermissionsReqDTO;
import com.sunday.boot3.user.center.provider.RolePermissionsProvider;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

/**
 * @Description: 角色权限关系表 provider impl 层
 * @author: zsy
 * @Create: 2024/09/22 16:24:39
 */
@Slf4j
@DubboService
@RequiredArgsConstructor
public class RolePermissionsProviderImpl implements RolePermissionsProvider {

    private final RolePermissionsController rolePermissionsController;

    /**
     * @Description: 新增 角色权限关系表 数据
     * @Param: [saveRolePermissionsReqDTO]
     * @Return: com.sunday.common.core.remoting.base.response.Response
     * @Author: zsy
     * @Time: 2024/09/22 16:24:39
     */
    @Override
    public Response save(SaveRolePermissionsReqDTO saveRolePermissionsReqDTO) {
        return rolePermissionsController.save(saveRolePermissionsReqDTO);
    }

    /**
     * @Description: 删除 角色权限关系表 数据
     * @Param: [removeRolePermissionsReqDTO]
     * @Return: com.sunday.common.core.remoting.base.response.Response
     * @Author: zsy
     * @Time: 2024/09/22 16:24:39
     */
    @Override
    public Response remove(RemoveRolePermissionsReqDTO removeRolePermissionsReqDTO) {
        return rolePermissionsController.remove(removeRolePermissionsReqDTO);
    }

    /**
     * @Description: 修改 角色权限关系表 数据
     * @Param: [updateRolePermissionsReqDTO]
     * @Return: com.sunday.common.core.remoting.base.response.Response
     * @Author: zsy
     * @Time: 2024/09/22 16:24:39
     */
    @Override
    public Response update(UpdateRolePermissionsReqDTO updateRolePermissionsReqDTO) {
        return rolePermissionsController.update(updateRolePermissionsReqDTO);
    }

    /**
     * @Description: 获取 角色权限关系表 分页列表数据
     * @Param: [pageRolePermissionsReqDTO]
     * @Return: com.sunday.common.core.remoting.base.response.Response<com.sunday.common.core.remoting.base.page.PageResultDTO<com.sunday.boot3.user.center.pojo.dto.role.permissions.PageRolePermissionsResDTO>>
     * @Author: zsy
     * @Time: 2024/09/22 16:24:39
     */
    @Override
    public Response<PageResultDTO<PageRolePermissionsResDTO>> page(PageRolePermissionsReqDTO pageRolePermissionsReqDTO) {
        return rolePermissionsController.page(pageRolePermissionsReqDTO);
    }

}